package cn.xuguowen.user.designPatten.strategy.hsp.strategy;

/**
 * ClassName: Client
 * Package: cn.xuguowen.user.designPatten.strategy.hsp.strategy
 * Description:
 * 客户端
 * @Author 徐国文
 * @Create 2023/4/28 14:19
 * @Version 1.0
 */
public class Client {

    public static void main(String[] args) {
        BeiJingDuck beiJingDuck = new BeiJingDuck();
        beiJingDuck.fly();
        beiJingDuck.quake();

        ToyDuck toyDuck = new ToyDuck();
        toyDuck.fly();
        toyDuck.quake();

        WildDuck wildDuck = new WildDuck();
        wildDuck.fly();
        wildDuck.quake();

        System.out.println("有一天，野鸭子腿受伤了，所以此时它也不会飞行了!嗓子还受伤了，不能发出声音了！");
        wildDuck.setFlyBehavior(new NoFlyBehavior(),new NoQuakeBehavior());
        wildDuck.fly();
        wildDuck.quake();
    }
}
